package com.bwie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bwie.pojo.Driver;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DriverMapper extends BaseMapper<Driver> {

    @Select("select d.*,u.username from driver as d left join user as u on d.user_id = u.id")
    List<Driver> driverList();

    @Update("update driver set driver_status = #{driverStatus} where id = #{id} ")
    void updateStatus(Driver driver);
}
